const $sql = require('../sqlfun');//sql语句
var models = require('../connectmysql');//数据库链接信息
var mysql = require('mysql');
var conn = mysql.createConnection(models.mysql);
conn.connect();
module.exports=(req, res) => {
  var sql = $sql.datames.selectfoodbbschild;
  var params = req.body;
  console.log("sql",sql);
  console.log("params",params);
  conn.query(sql,[params.articleTopic], function(err, data) {
    if(err){
      var result={
        "status":"500",
        "message":"服务器错误",
        "data":err
      }
      console.log(result);
      res.send(result);
    }
    else {
      var result={
        "status":"200",
        "message":"success",
        data:data
      }
      console.log(result);
      res.send(result);
    }
  })
}
